# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.OSConfig.V1.Model.OSPolicyAssignmentRollout do
  @moduledoc """
  Message to configure the rollout at the zonal level for the OS policy assignment.

  ## Attributes

  *   `disruptionBudget` (*type:* `GoogleApi.OSConfig.V1.Model.FixedOrPercent.t`, *default:* `nil`) - Required. The maximum number (or percentage) of VMs per zone to disrupt at any given moment.
  *   `minWaitDuration` (*type:* `String.t`, *default:* `nil`) - Required. This determines the minimum duration of time to wait after the configuration changes are applied through the current rollout. A VM continues to count towards the `disruption_budget` at least until this duration of time has passed after configuration changes are applied.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :disruptionBudget => GoogleApi.OSConfig.V1.Model.FixedOrPercent.t() | nil,
          :minWaitDuration => String.t() | nil
        }

  field(:disruptionBudget, as: GoogleApi.OSConfig.V1.Model.FixedOrPercent)
  field(:minWaitDuration)
end

defimpl Poison.Decoder, for: GoogleApi.OSConfig.V1.Model.OSPolicyAssignmentRollout do
  def decode(value, options) do
    GoogleApi.OSConfig.V1.Model.OSPolicyAssignmentRollout.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.OSConfig.V1.Model.OSPolicyAssignmentRollout do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
